// header file for the Division class
#ifndef __DIVISION__
#define __DIVISION__

#include "Consthead.hpp"
class Team; // there is a class 'Team'
class Result; // there is a class 'Result'

struct Table {
	Team* team; // this tables team
	int played, won, tied, lost, goals, points; // the various entities of a table
	Table(Team* sentteam) { // constructor/initializer
	team = sentteam;
	played = won = tied = lost = goals = points = 0;
	}
};

class Division : public Text_element { // class holds relevant info within its division
private:
    int teamcount; // a counter, incremented with each new team
    Team* teamsarr[MAXTEAMS]; // keeps all the registered
    // teams in this division within itself
    Result* schedule[MAXTEAMS][MAXTEAMS]; // matrix having all results in division in it
    
    friend void displaytp();
    friend void changepl();
    friend void printWriteMatchResults();
    friend void readResults(ifstream* in);
    
public:
    Division(); // default constructor // should not be used
    Division(ifstream* in, char* sentname = NULL); // read division from file
    Division(char* sentname); //SHOULD NOT BE USED// constructor
    // sends correct parameter to correct parent constructor
    void display(); // inherited from 'Text_element'
    void writeToFile(ofstream* out);
    void addTeam();
    
    void printSchedule();
    void writeSchedule(ofstream* out);
    void printWriteTable(ostream* out, int pointtype); // print/write table to screen/file
    
};
#endif
